﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace GeoSwarm_Editor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            if (args.Length > 0 && args[0] == "debug")
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Main());
            }
            else
            {
                try
                {
                    Application.EnableVisualStyles();
                    Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new Main());
                }
                catch (Exception ex)
                {
                    try
                    {
                        Application.Run(new ExceptionDialog(ex));
                    }
                    catch (Exception) { }
                    finally { Application.Exit(); }
                }
            }
        }
    }
}
